package com.gxa.saas.service.impl;

import com.gxa.saas.mapper.PurchaseRequestMapper;
import com.gxa.saas.pojo.Purchase;
import com.gxa.saas.pojo.PurchaseRequest;
import com.gxa.saas.service.PurchaseRequestService;
import com.gxa.saas.service.PurchaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PurchaseRequestServiceImpl implements PurchaseRequestService {

    @Autowired
    PurchaseRequestMapper purchaseRequestMapper;

    @Override
    public List<PurchaseRequest> selectBySecondPage(Integer offset, Integer size) {
        return purchaseRequestMapper.selectBySecondPage(size*(offset-1),size);
    }

    @Override
    public Integer insert(PurchaseRequest purchaseRequest) {
        return purchaseRequestMapper.insert(purchaseRequest);
    }

    @Override
    public List<PurchaseRequest> selectLikeName(String name, Integer offset, Integer size) {
        return purchaseRequestMapper.selectLikeName(name, offset, size);
    }

    @Override
    public Integer update(Purchase purchase) {
        return purchaseRequestMapper.update(purchase);
    }


}
